package reflect;

import reflect.annotations.AutoRunMethod;

import java.lang.reflect.Method;

public class ReflectDemo9 {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {
        Class cls = Class.forName("reflect.Person");
        Method method = cls.getMethod("eat");
        if(method.isAnnotationPresent(AutoRunMethod.class)){
            System.out.println("被标注了！");
        }else{
            System.out.println("没有被标注！");
        }
    }
}
